        // disabling dates
 	$(function(){
 	    var nowTemp = new Date();
      var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0);
  
			var filterFromDate = new Date( $("#filter_start_date").val().replace( /(\d{2})-(\d{2})-(\d{4})/, "$2/$1/$3") );
			var filterToDate = new Date( $("#filter_end_date").val().replace( /(\d{2})-(\d{2})-(\d{4})/, "$2/$1/$3") );
  		
      var filterDatepickerFrom = $('#filter_start_date').datepicker({
          format: 'dd-mm-yyyy',
          language: 'es',
          weekStart: 1,
        	onRender: function(date) {
						//return date.valueOf() < now.valueOf() ? 'disabled' : '';
					}
				}).on('changeDate', function(ev) {
          filterFromDate = new Date(ev.date);
          if(filterToDate.valueOf() < filterFromDate.valueOf()){
          	filterDatepickerTo.setValue(filterFromDate);
          }
          
          filterDatepickerFrom.hide();
          filterDatepickerTo.update();
          $('#filter_end_date')[0].focus();
        }).data('datepicker');
        
      var filterDatepickerTo = $('#filter_end_date').datepicker({
          format: 'dd-mm-yyyy',
          language: 'es',
          weekStart: 1,
        	onRender: function(date) {
						return date.valueOf() < filterFromDate.valueOf() ? 'disabled' : '';
					}
				}).on('changeDate', function(ev) {
          filterToDate = new Date(ev.date);
          filterDatepickerTo.hide();
        }).data('datepicker');
        

			$("#btn-filter-date").click(function(e){
    		e.preventDefault();
    		var dateFrom = $("#filter_start_date").val();
    		var dateTo = $("#filter_end_date").val();
    		var filter = $(this).data('filter');
    		document.location.href="index.php?filter_date="+dateFrom+","+dateTo+filter;
    	});
	});
	


